package pack1021;

public class DemoB {
    public static void main(String[] args) {
        DemoB1 da = new DemoB1();
        DemoB2 db = new DemoB2(da);
        db.a();
    }

}
class DemoB1{
    public void a(){
        System.out.println("sss");
    }
}
class DemoB2{
    private DemoB1 da;
    public DemoB2(DemoB1 da) {
        this.da = da;
    }

    public void a(){
        System.out.println("bbb");
        da.a();
    }
}